source /opt/ros/humble/setup.bash

if [ -d /code ]; then
  cd /code
fi

colcond() {
  if [ "$(pwd)" == "/code" ]; then
    echo "ERROR: Please do not run colcon commands in /code." >&2
    echo "       Instead, run it in one of the exercise directories." >&2
    return 1
  fi

  #/usr/bin/colcon "$@"
  colcon build --symlink-install \
    --cmake-args \
    -DTRACETOOLS_DISABLE=ON \
    -DCMAKE_BUILD_TYPE:STRING=Debug \
    -DBUILD_TESTING=OFF \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
    -DCMAKE_VERBOSE_MAKEFILE=ON \
    --no-warn-unused-cli \
    --cmake-force-configure
}
